package com.boang.set;

import java.util.HashSet;

/*
    @author:sa
    @date:2024/11/29 11:18
*/
public class HashSetDemo {
    public static void main(String[] args) {
        m1();
//        m2();
    }

    private static void m2() {
        HashSet<String> set = new HashSet<>();
        set.add("张三");
        set.add("张三");
        set.add("李四");
        System.out.println(set);
    }

    private static void m1() {
        HashSet<Student> set = new HashSet<>();
        set.add(new Student("张三", 20));
        set.add(new Student("张三", 20));
        set.add(new Student("李四", 30));
        System.out.println(set);
    }
}